#!/usr/bin/env python
# encoding: utf-8
"""
@Author: Beam
@Mail:506556658@qq.com
@file: authforms.py
@time: 2017/9/20 21:15

@用于登录和注册的表单验证

"""

from django import forms

class LoginForm(forms.Form):
	username = forms.CharField(min_length=4,
	                           max_length=12,
	                           error_messages={'required':'用户名不能为空','min_length':'长度必须大于4个字符','max_length':'必须小于12个字符'},
	                           widget=forms.TextInput(attrs={'class':"form-control",'id':'inputUser3','placeholder':'Username'}),
	                           )

	password = forms.CharField(min_length=8,
	                           max_length=18,
	                           error_messages={'required':'密码不能为空','min_length':'长度必须大于8个字符','max_length':'密码必须小于18个字符'},
	                           widget=forms.PasswordInput(attrs={'class':"form-control",'id':'inputPassword3','placeholder':'Password'}),
	                           )
	def __init__(self,*args,**kwargs):
		super(LoginForm,self).__init__(*args,**kwargs)



